package com.itheima.socket.tcp.demo04;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.TimeUnit;

public class ServerDemo01 {

    public static void main(String[] args) throws IOException, InterruptedException {

        ServerSocket serverSocket = new ServerSocket(9999) ;		// 创建ServerSocket对象
        Socket socket = serverSocket.accept();						// 获取连接对象
        TimeUnit.SECONDS.sleep(15);							// 线程休眠
        socket.close();												// 释放资源
        serverSocket.close();										// 释放资源

    }

}
